package com.wbl.tijiancms.controller;

import com.wbl.tijiancms.pojo.Doctor;
import com.wbl.tijiancms.response.ApiRestResponse;
import com.wbl.tijiancms.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/doctor")
public class DoctorController {

    @Autowired
    DoctorService doctorService;

    @ResponseBody
    @GetMapping("/getAll")
    public ApiRestResponse getDoctorList(){
        return doctorService.getUserAll();
    }

    @ResponseBody
    @PostMapping("/login")
    public ApiRestResponse login(@RequestBody Doctor doctor){
        return doctorService.login(doctor);
    }


}
